@extends('admin::layouts.master')
@section('content')
    @if ($errors->any())
        <div class="alert alert-danger">
            <ul>
                @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
    @endif
    <form action="{{route('admin.update',$user['id'])}}" method="post">
        @csrf
        @method('PUT')
        <div class="card">
            <div class="card-header">
                <ul class="nav nav-tabs" role="tablist">&nbsp;
                    <li class="active">编辑用户资料，请谨慎操作</li>
                </ul>
            </div>
            <div class="card-body">
                <div class="form-group">
                    <label>用户名</label>
                    <input type="text" name="name" class="form-control" value="{{$user['name']}}">
                </div>
                <div class="form-group">
                    <label>邮箱</label>
                    <input type="email" name="email" class="form-control" value="{{$user['email']}}">
                </div>
                <div class="form-group">
                    <label>密码</label>
                    <input type="password" name="password" class="form-control"  value="">
                </div>
                <div class="form-check">
                    <input type="checkbox" class="form-check-input" value="1" @if($user['is_admin']) checked @endif name="is_admin">
                    <label class="form-check-label">超级管理员</label>
                </div>
            </div>
            <div class="card-footer text-muted">
                <button type="submit" class="btn btn-primary">进行编辑</button>
            </div>
        </div>
    </form>
@endsection


